#include "io.h"
#include "shell.h"
#include "cmd_list.h"
#include "motor.h"


/**
 * example
 */

int func(int i, int j,char ch, char *str)
{
    printf("input int: %d, char: %c, string: %s\r\n", i, ch, str);
    int temp = 0;
    temp=i+100*j;
    return temp;
}
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), testfunc, func, this is a c like function);
int func_float(float x,int y)
{
	printf("input float: %f,int: %d\r\n", x, y);
	return 0;
}
SHELL_EXPORT_CMD_AGENCY(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC),testfunc_float, func_float, this is a c like function input float,SHELL_PARAM_FLOAT(p1),p2);






void power(uint8_t sta)
{
	if(sta)
	{
		power_on();
	}else {
		power_off();
	}
}
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), power, power, (uint8_t sta));



void fan(uint8_t sta)
{
	if(sta)
	{
		fan_on();
	}else {
		fan_off();
	}
}
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), fan, fan, (uint8_t sta));



void motor(uint8_t motor,uint8_t speed)
{
	motor_set_speed(motor,speed);
}
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), motor, motor, (uint8_t motor,uint8_t speed));

